'use strict';

// const Controller = require('egg').Controller;

// class HomeController extends Controller {
//   async index() {
//     const { ctx } = this;
//     ctx.body = 'hi, egg';
//   }
// }

// module.exports = HomeController;


exports.index = async ctx => {
  const users = await ctx.model.User.findAll();
  ctx.body = users;
};


exports.show  = async ctx=> {
  const user = await ctx.model.User.findByLogin(ctx.params.login);
  await user.logSignin();
  ctx.body = user;
}